<?php

/*

Change Club Info (club_change.pro.php)

*/
ob_start();
$page_title = "Change Club Info";
$rank_check = 1;
include "header.inc.php";
$clubrank_check = 3;
$page_heading = "Home";
include "club.inc.php";

if ((!$edit_club_name) OR (!$edit_club_slogan) OR (!$club_info))
{
	die(header(error("club_change.php?game=$game&clubid=$clubid", "Please do not leave any required information blank!")));
}

$check = check_length($edit_club_name,24);
if ($check == 0)
{
	die(header(error("club_change.php?game=$game&clubid=$clubid","Your club's name can only be 24 characters.")));
}
$check = check_length($edit_club_slogan,64);
if ($check == 0)
{
	die(header(error("club_change.php?game=$game&clubid=$clubid","Your club's motto can only be 64 characters.")));
}
$check = check_length($club_info,10000);
if ($check == 0)
{
	die(header(error("club_change.php?game=$game&clubid=$clubid","Your club's description can only be 1024 characters.")));
}


mysql_query("UPDATE clubs2 SET name = '$edit_club_name' WHERE id = '$clubid' AND game = '$game'");
mysql_query("UPDATE clubs2 SET motto = '$edit_club_slogan' WHERE id = '$clubid' AND game = '$game'");
mysql_query("UPDATE club_pages2 SET data = '$club_info' WHERE page = '1' AND club = '$clubid' AND game = '$game'");

header("Location: $base_url/club_change.php?game=$game&error=Your+club+has+been+edited.&clubid=$clubid");

?>